/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfacesGraficas;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JInternalFrame;

/**
 *
 * @author eduardo
 */
public class ControladorSubSistemaDePermisos extends Controlador {

    private ControladorPrincipal cp;
    private PantallaInicioSesion pis;

    public ControladorSubSistemaDePermisos() {

        pis = new PantallaInicioSesion();
        pis.setTitle("SISTEMA - ESTRUCTURAS SA");

        //boton ingresar
        pis.getBotoningresar().addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent ae) {
                iniciarSesion();
            }
        });

        pis.getCampoclave().addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent ae) {
                iniciarSesion();
            }
        });


    }

    @Override
    public void iniciar() {
        pis.setVisible(true);
        pis.setLocationRelativeTo(null);


    }

    private void iniciarSesion() {
        ControladorPrincipal.getInstancia().iniciar();
        pis.setVisible(false);
    }

    @Override
    public void finalizar() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public JInternalFrame getPantalla() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void continuar() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    
}
